package com.acme;


public class Test {
	public static void main(String[] args) {
		int v1 = 3;
		byte v2 = (byte)v1; //byte v2 = v1; will not compile, because v1 is int, compiler can cot conver to byte automatically, we should use cast (byte)
		System.out.println(v2);
		v1 = 256;
		byte v3 = (byte) v1; //byte v3 = v1; will not compile, because v1 is int, compiler can cot conver to byte automatically, we should use cast (byte)
		System.out.println(v3); // Pints 0, because 256 is 100000000 in binary, we can use cast and compiler will remove all bits, except last 8 bits.
		int v4 = 's'; //Takes charCode, s == 115
		System.out.println(v4); // 115
		
		byte v5 = 115; 
		if (v5 == 's') { // Compare charCode of 's' with 115, returns TRUE
			System.out.println("Equals");
		}
		
		//TODO: What exactly will be printed?
		System.out.println((double)4); // Converts int 4 to double, returns 4.0
		
		//TODO: What exactly will be printed?
		double d = 5;
		System.out.println(d + 1); //6.0
		
		boolean b = (v4 > 0)?true:false;// boolean b = (boolean) v4; Compiler don't know what is true and false, so we can not cast int to bool, we can compare value with 0
		
		//short v6 = "short"; // We can not conver String (not char, exactly String) to int.
		
		float v7 = 3.67f; // float v7 = 3.67; all digits with dot (.) are double by default, we should use f or cast
		
		float v9 = 3;//TODO: Why there is no compilation error? Because compiler can convert from float to int, from least to most.
		
		int v8 = (int)v7; // Compiler can not convert from most to least, let's use (cast)!
		
		int array[] = new int[27]; // We defined array of int, so we should create new instance of int array, not double
		
	}
}
